import { createRequest } from '@/request'
import { formData } from '@/request/common'

// 获取学习资料文件列表
export const learningMaterialFileGet = learningId => {
  return createRequest({
    url: `/teacher/learning-material-file/get/${learningId}`,
    method: 'get',
  })
}

// 上传文件
export const learningMaterialFileUpload = (type, learningId, data) => {
  return createRequest({
    url: `/teacher/learning-material-file/upload/${type}/${learningId}`,
    method: 'post',
		data: formData(data)
  })
}

// 保存
export const learningMaterialFileSave = (learningId, data) => {
  return createRequest({
    url: `/teacher/learning-material-file/save/${learningId}`,
    method: 'post',
		data
  })
}
